<template>
  <div class="icons-container">
    <div v-for="appGroup of applications" :key="appGroup" >
      <el-row>
        <span class="app-title">{{ appGroup.title }}</span>
        <el-divider/>
        <div v-for="app of appGroup.apps" :key="app" shadow="hover" @click="handleClick(app.path,app.title,app)">

          <!-- <el-tooltip placement="top"> -->
          <el-col :xs="24" :sm="6" :md="3" :lg="3" :xl="3">
            <div :class="app.style" style="border:1px">
              <svg-icon :icon-class="app.icon" />
              <span>{{ app.title }}</span>
            </div>
          </el-col>
          <!-- </el-tooltip> -->

        </div>
      </el-row>
    </div>
  </div>
</template>

<script>
  import applications from './applications'

  export default {
    name: 'App',
    data() {
      return {
        applications
      }
    },
    methods: {
      handleClick(path, title, app) {
        if (app.style === 'icon-item-disable') {
          return
        }
        var _this = this
        var _window = window
        // this.$message({ type: 'success', message: '即将跳转到功能:' + title })
        // console.log('即将跳转到path:' + path)
        _this.$router.push({ 'path': path })
        _window.location.href = path
      }
    }
  }
</script>

<style lang="scss" scoped>
  .app-title {
    margin:0px 15px 5px 5px;
    font-family: "Microsoft YaHei","微软雅黑",Arial,sans-serif;
    font-size: 19px;
    font-weight: 700
  }
  .icons-container {
    margin: 20px 0px 0;
    overflow: hidden;
  }
  .icon-item {
    margin:5px 5px 5px 5px;
    height: 80px;
    border: 1px;
    text-align: center;
    width: 90px;
    float: left;
    font-size: 40px;
    font-family: "Microsoft YaHei","微软雅黑",Arial,sans-serif;
    font-weight: 600;
    color: #24292e;
    cursor: pointer;
  }
  .icon-item:hover {
    margin-top: 5px;
    box-shadow: 0 3px 15px 3px rgba(51, 51, 51, 0.5);
  }
  .icon-item span {
    color: black;
  }
  .icon-item-disable {
    margin:5px 5px 5px 5px;
    height: 80px;
    border: 1px;
    text-align: center;
    background-color: #cacccc;
    width: 90px;
    float: left;
    font-size: 40px;
    color: #cacccc;
    text-decoration-color: #424242;
    font-family: "Microsoft YaHei","微软雅黑",Arial,sans-serif;
    font-weight: 600;
    color: #000000;
  }
  .icon-item-disable span {
    color: #7f8181
  }
  span {
    display: block;
    font-size: 16px;
    margin-top: 10px;
  }

  .disabled {
    pointer-events: none;
  }

  .el-divider--horizontal{
    display: block;
    height: 1px;
    width: 100%;
    margin: 0px 0px 5px 0px;
  }

</style>
